import React from 'react'
import {Route,Switch,useHistory} from 'react-router-dom';
import Login from './Login';
import Default from './Default';
                                                                                                
//
const Content = () => {
    const history = useHistory()
    if(!localStorage.getItem("isLogin")){
        history.replace('/login')
    }else{
        history.replace('/')
    }
    
    return (
        <div>
            <Switch>
                <Route exact path="/"> <Default/></Route>
                <Route path="/index"><Default/></Route>
                <Route path="/login"> <Login history={history}/></Route>
            </Switch>
        </div>
    )
}

export default Content